# Makefile for CMyMan
# ----------------------------------------------
# Author : Alex Woo-Hyun Kim at www.webrobot.org
# E-mail : woorung@empal.com or woorung@webrobot.org
# Date : Apr. 17, 2002
include ../../etc/profile.mk

#DEFS = -Wno-deprecated

#LIB = -R/usr/local/lib -lstdc++
LIB = -L/usr/local/lib/gcc-lib/i386-pc-solaris2.8/2.95.3 -lstdc++
INCLUDE = -I/usr/local/include -I/usr/local/include/g++-v3

MYSQLPATH = /naver/woorung/mysql
INCLUDES = -I$(MYSQLPATH)/include/mysql
LIBS = -L$(MYSQLPATH)/lib/mysql -lmysqlclient

CSTPATH = ../~CStringTokenizer
CSTINCLUDES = -I$(CSTPATH)
OBJS = CStringTokenizer.o CMyConMan.o CMyResultSet.o CMyStatement.o CMyMan.o CMyManTest.o

DEBUGSRC = $(CSTPATH)/CStringTokenizer.cpp CMyConMan.cpp CMyResultSet.cpp CMyStatement.cpp CMyMan.cpp CMyManTest.cpp
DEBUGINCLUDES = $(CSTINCLUDES) $(INCLUDES)
DEBUGLIBS = $(LIBS)
DEBUGFLAGS = -DDEBUG

all : CMyManTest lib lib-allinone

CMyManTest : $(OBJS)
	g++ $(DEFS) -o CMyManTest $(OBJS) $(LIBS) $(LIB)
	@echo done.

CMyManTest.o : CMyManTest.cpp
	g++ $(DEFS) -c CMyManTest.cpp $(INCLUDE) $(INCLUDES)

CMyMan.o : CMyMan.cpp CMyMan.h
	g++ $(DEFS) -c CMyMan.cpp $(INCLUDES) $(INCLUDES)

CMyStatement.o : CMyStatement.cpp CMyStatement.h $(CSTPATH)/CStringTokenizer.h
	g++ $(DEFS) -c CMyStatement.cpp $(INCLUDES) $(INCLUDE) $(CSTINCLUDES)

CMyResultSet.o : CMyResultSet.cpp CMyResultSet.h
	g++ $(DEFS) -c CMyResultSet.cpp $(INCLUDES)

CMyConMan.o : CMyConMan.cpp CMyConMan.h
	g++ $(DEFS) -c CMyConMan.cpp $(INCLUDES) $(CSTINCLUDES)

CStringTokenizer.o : $(CSTPATH)/CStringTokenizer.cpp $(CSTPATH)/CStringTokenizer.h
	g++ $(DEFS) -c $(CSTPATH)/CStringTokenizer.cpp $(CSTINCLUDES)

lib :
	ar -ruv $(WNL)/libwn.a CMyMan.o CMyResultSet.o CMyConMan.o
	ranlib $(WNL)/libwn.a
	@echo libwn.a completed.

lib-allinone :
	ar -ruv $(WNL)/libwn-allinone.a CMyMan.o CMyResultSet.o CMyConMan.o
	ranlib $(WNL)/libwn-allinone.a
	@echo libwn-allinone.a completed.

clean :
	\rm -f *.o CMyManTest CMyManDebug debug

debug : 
	g++ -o CMyManDebug $(DEBUGSRC) $(DEBUGINCLUDES) $(DEBUGLIBS) $(DEBUGFLAGS)
